package controller;

import java.util.List;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import entity.Power;
import entity.Role;

import biz.AnnounceBiz;
import biz.PowerBiz;
@Controller
public class PowerController extends MultiActionController {
	private PowerBiz powerBiz;

	@RequestMapping("/power/findAll.do")
	@ResponseBody
	public String findAll(){		
		List<Power> power = powerBiz.findAll();
        JSONArray jsons = JSONArray.fromObject(power);
        System.out.println(jsons.toString());
        return jsons.toString();
	}
	
	public PowerBiz getPowerBiz() {
		return powerBiz;
	}

	public void setPowerBiz(PowerBiz powerBiz) {
		this.powerBiz = powerBiz;
	}
	
	
	
}
